QuickTime 3 Reference

Previous | Chapter Top | Chapter Contents | Next

Enhancing Movie Playback Performance

Two new functions allow you to get and set a portion of a preloaded track. There is also a new function for working with modifier tracks.

SetTrackLoadSettings

The SetTrackLoadSettings function allows you to specify a portion of a track that is to be loaded into memory whenever it is played.

pascal void SetTrackLoadSettings (Track theTrack, TimeValue preloadTime, TimeValue
                     preloadDuration, long preloadFlags, long defaultHints);
theTrack
Specifies the track for this operation. Your application obtains this track identifier from such Movie Toolbox functions as NewMovieTrack and GetMovieTrack .
preloadTime
Specifies the starting point of the portion of the track to be preloaded. Set this parameter to -1 if you want to preload the entire track (in this case the function ignores the preloadDuration parameter). This should be specified in the movie's time scale.
preloadDuration
Specifies the amount of the track to be preloaded, starting from the time specified in the preloadTime parameter. If you are preloading the entire track, the function ignores this parameter.
preloadFlags
Controls when the Movie Toolbox preloads the track. The function supports the following flag values:
preloadAlways
Specifies that the Movie Toolbox should always preload this track, even if the track is disabled.
preloadOnlyIfEnabled
Specifies that the Movie Toolbox should preload this track only when the track is enabled.
Set this parameter to 0 if you do not want to preload the track.
defaultHints
Specifies playback hints for the track. You may specify any of the supported hints flags. See "Hints" for descriptions of new hint flags in QuickTime.

Description

The SetTrackLoadSettings allows you to control how the Movie Toolbox preloads the tracks in your movie. By using these settings, you make this information part of the movie, so that the preloading takes place every time the movie is opened, without an application having to call the LoadTrackIntoRAM function. Consequently, you should use this feature carefully, so that your movies do not consume large amounts of memory when opened.

Special Considerations

The Movie Toolbox transfers this preload information when you call the CopyTrackSettings function. In addition, the preload information is preserved when you save or flatten a movie (using either the FlattenMovie or FlattenMovieData functions). In flattened movies, the tracks that are to be preloaded are stored at the start of the movie, rather than being interleaved with the rest of the movie data. This improves preload performance.

RESULT CODES

invalidTrack

-2009

This track is corrupted or invalid

GetTrackLoadSettings

The GetTrackLoadSettings function allows you to retrieve a track's preload information.

pascal void GetTrackLoadSettings (Track theTrack, TimeValue *preloadTime, TimeValue
                     *preloadDuration, long *preloadFlags, long *defaultHints);
theTrack
Specifies the track for this operation. Your application obtains this track identifier from such Movie Toolbox functions as NewMovieTrack and GetMovieTrack .
preloadTime
Specifies a field to receive the starting point of the portion of the track to be preloaded. The Movie Toolbox returns a value of -1 if the entire track is to be preloaded.
preloadDuration
Specifies a field to receive the amount of the track to be preloaded, starting from the time specified in the preloadTime parameter. If the entire track is to be preloaded, this value is meaningless.
preloadFlags
Specifies a field to receive the flags that control when the Movie Toolbox preloads the track. The function supports the following flag values:
preloadAlways
Specifies that the Movie Toolbox always preloads this track.
preloadOnlyIfEnabled
Specifies that the Movie Toolbox preloads this track only when the track is enabled.
defaultHints
Specifies a field to receive the playback hints for the track.

RESULT CODES

invalidTrack

-2009

This track is corrupted or invalid

GetTrackDisplayMatrix

The GetTrackDisplayMatrix function returns a matrix which is the concatenation of all matrices currently effecting the track's location, scaling, and so on. This includes the movie's matrix, the track's matrix, and the modifier matrix. Since modifier information is passed between tracks at MoviesTask time, the information returned by this call will represent the matrix in effect at the last MoviesTask call.

pascal OSErr GetTrackDisplayMatrix(
                     Track theTrack,
                     MatrixRecord *matrix );
theTrack
Specifies the track for this operation. Your application obtains this track identifier from such Movie Toolbox functions as NewMovieTrack and GetMovieTrack .
matrix
Contains a pointer to a matrix structure.

To determine the entire clip of a track at the current time using GetTrackDisplayBoundsRgn . The results of GetTrackDisplayBoundsRgn take into account any clip regions provided by modifier tracks.

RESULT CODES

invalidTrack

-2009

This track is corrupted or invalid


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next